<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActivityGroupPriceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //拼团活动拼团价设置表
        Schema::create('activity_group_price', function(Blueprint $table) {
            $table->increments('id')->comment('自增id');
            $table->integer('activity_group_id')->default(0)->comment('拼团活动id');
            $table->integer('goods_id')->default(0)->comment('商品id');
            $table->integer('goods_spu_id')->default(0)->comment('商品属性id');
            $table->decimal('many_price')->default(0)->comment('团购价');
            $table->softDeletes();
            $table->timestamps();
        });

        //删除单人活动价，团购价，商品属性id
        Schema::table('activity_group', function (Blueprint $table) {
            $table->dropColumn(['goods_spu_id', 'single_money', 'many_money']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
